/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.test.mainframe;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author lego
 */
@Entity
@Table(name = "ASTIST", catalog = "", schema = "ADMIN1")
@NamedQueries({
    @NamedQuery(name = "Astist.findAll", query = "SELECT a FROM Astist a"),
    @NamedQuery(name = "Astist.findByArtistid", query = "SELECT a FROM Astist a WHERE a.artistid = :artistid"),
    @NamedQuery(name = "Astist.findByArtistsurname", query = "SELECT a FROM Astist a WHERE a.artistsurname = :artistsurname"),
    @NamedQuery(name = "Astist.findByArtistname", query = "SELECT a FROM Astist a WHERE a.artistname = :artistname"),
    @NamedQuery(name = "Astist.findByBandmember", query = "SELECT a FROM Astist a WHERE a.bandmember = :bandmember")})
public class Astist implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ARTISTID")
    private Integer artistid;
    @Basic(optional = false)
    @Column(name = "ARTISTSURNAME")
    private String artistsurname;
    @Column(name = "ARTISTNAME")
    private String artistname;
    @Column(name = "BANDMEMBER")
    private String bandmember;

    public Astist() {
    }

    public Astist(Integer artistid) {
        this.artistid = artistid;
    }

    public Astist(Integer artistid, String artistsurname) {
        this.artistid = artistid;
        this.artistsurname = artistsurname;
    }

    public Integer getArtistid() {
        return artistid;
    }

    public void setArtistid(Integer artistid) {
        Integer oldArtistid = this.artistid;
        this.artistid = artistid;
        changeSupport.firePropertyChange("artistid", oldArtistid, artistid);
    }

    public String getArtistsurname() {
        return artistsurname;
    }

    public void setArtistsurname(String artistsurname) {
        String oldArtistsurname = this.artistsurname;
        this.artistsurname = artistsurname;
        changeSupport.firePropertyChange("artistsurname", oldArtistsurname, artistsurname);
    }

    public String getArtistname() {
        return artistname;
    }

    public void setArtistname(String artistname) {
        String oldArtistname = this.artistname;
        this.artistname = artistname;
        changeSupport.firePropertyChange("artistname", oldArtistname, artistname);
    }

    public String getBandmember() {
        return bandmember;
    }

    public void setBandmember(String bandmember) {
        String oldBandmember = this.bandmember;
        this.bandmember = bandmember;
        changeSupport.firePropertyChange("bandmember", oldBandmember, bandmember);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (artistid != null ? artistid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Astist)) {
            return false;
        }
        Astist other = (Astist) object;
        if ((this.artistid == null && other.artistid != null) || (this.artistid != null && !this.artistid.equals(other.artistid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.test.mainframe.Astist[ artistid=" + artistid + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
